Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract basic OAuth2 functionality from SportTracks so it can be used elsewhere #103

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mduggan
Copy link
Contributor

@mduggan mduggan commented Feb 14, 2015

I started looking at doing #86 Google Fit support, but the Google API libraries don't have code for it beyond doing OAuth2 - and that was already the ugliest part of the way I implemented #93 Google Drive support, since it doesn't support requests.

Instead, I thought it might be nicer to pull the OAuth2 functionality out of SportTracks and make it available for other services.

There are 2 small behaviour changes to the sporttracks code:

  1. The token refresh does not pass a redirect_uri - that was hard coded so it can run outside Django, and shouldn't be needed anyway according to http://tools.ietf.org/html/rfc6750#section-3
  2. The download now uses a requests.Session so it will recycle connections when downloading multiple activities. I'm not sure if this has potential to trigger some sort of rate limiting?

If you like this refactor I'll probably rewrite #93 to drop the google API client library - it doesn't do much and requests is so much nicer. Will also give #86 a bash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant